.NET Tray App as Web Proxy for Remote Server

SuperJason

Posted by SuperJason // Fri, May 19, 2006 2:48 PM



Hopefully I can describe this so that it's easy to understand...

I'm trying to write a .NET tray application that a user will install. This tray application will periodically poll a remote web server. The remote web server needs to be able to use the connection of the machine the tray application is on.

One way to do this is to have the server queue up a list of requests to be made, and the tray app asks for the list, makes the request, and then reports back the results.

Is there a better way to do it? I would like to be able to somehow hand over the Internet connection from the tray app to the server, so that it can act like a proxy.

The reason I'm doing this is because the server does most of the work, but the client is supposed to make the requests. Some of the requests depend on previous requests, so it would be easiest if I could just get the connection somehow, and use it however I want, and then disconnect.

Thanks for any crazy ideas anyone can come up with!

  littleguru
  girlfriend left, niner right
 
  Sat, May 20 2006 4:08 AM
You want the server to call you back? I mean you drop him a lot of work and once he is finished you want him to call you back, right?

  ben2004uk
  Microsoft Student Partner
 
  Sun, May 21 2006 12:50 PM
from what I could understand you just want a classic Client/Server approach using Web Services.

Client calls on Servers web service and asks it to do some processing.

Server does whatever it wants and then returns whatever to the client as part of the web service request.

We talking minutes or hours here? If you are talking hours you will want to have the client as a web service as well so the Server talks to that on the way back.  Minutes you would just keep the connection open.


  SuperJason
 
 
  Mon, May 22 2006 9:57 AM


The client could be behind a firewall, so he really needs to initiate the communications. We're taking about requesting a few dozen pages at best, so I can keep the connection open.

I've been thinking about how to have the server tell the client what to do. From what I can tell, I'll just have to send over a few pieces of information. I was really hoping that the HttpWebRequest was serializable, so that I could just send it over. I was basically wondering if anyone had a slick way of passing over the request, and then the client could make that request, and then send back the response to the server.

At this point I'm thinking that there is no super easy shortcut to take.



  Ajai
 
 
  Mon, May 22 2006 10:48 AM
Hi I'm new to this Blog .. Any one can help to serialize a bitmap/Image object using .Net Remoting . Now I'm using a shortcut to Serialize.. like writing the Image to memory stream and Read Itinto an an Array(Byte) and send this to the client .. On the client side Im Writing It into a memory stream and reading it into a Bitmap Object :(

Any one can help me to solve the serialization of Bitmap sothat I can return Bitmap from My server like

Bitmap GetBitmap()
{
return Bitmap.FromFile("C:\\\\")
}